<?php
use Yaf\Controller_Abstract;

class UserController extends \App\controllers\BaseController {
    public function init() {
        // 禁用自动渲染视图
        Yaf\Dispatcher::getInstance()->autoRender(false);
    }

    public function indexAction() {
        // Your code here
        // 模拟一些用户数据
        $userInfo = [
            'id' => 1,
            'name' => 'John Doe',
            'email' => 'john.doe@example.com'
        ];

        // 设置响应的Content-Type为application/json
        header('Content-Type: application/json');

        // 输出JSON数据
        echo json_encode($userInfo);
    }

    public function profileAction() {
        echo "<pre>";print_r($data);exit;
        // Your code for profile action
    }

    // Other actions as needed
}